package com.zfast.yugioh.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zfast.forge.common.BaseService;
import com.zfast.forge.common.Page;
import com.zfast.yugioh.model.UserRole;
import com.zfast.yugioh.mapper.UserRoleMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * 用户角色关系表
 *
 * @author zgn
 * @email 
 * @date 2022-06-11 15:07:43
 */
@Service("userRoleService")
public class UserRoleService extends BaseService<Integer, UserRole> {
    public UserRoleService(UserRoleMapper mapper) {
        super(mapper);
    }

    @Resource
    UserRoleMapper userRoleMapper;

    public PageInfo<UserRole> pageList(Page<UserRole> page) {
        PageHelper.startPage(page.getNum(), page.getSize());
        List<UserRole> list = userRoleMapper.selectLikeUserRole(page.getData());
        PageInfo<UserRole> pageInfo = new PageInfo(list);
        return pageInfo;
    }
}

